#from django.db import connection
import time
import datetime
from django.http import HttpResponse

def hello(request):
  return HttpResponse("Hello world")
  
def curtime(request):
  ctime=time.strftime('%Y-%m-%d',time.localtime(time.time()))
  return HttpResponse(ctime)
  
def helloguy(request,guyname):
  #res='hello '+ guyname +'!'
  res=unicode.format('hello %s!' % (guyname))
  return HttpResponse(res)
  
def hours_ahead(request, offset):
    try:
        offset = int(offset)
    except ValueError:
        raise Http404()
    dt = datetime.datetime.now() + datetime.timedelta(hours=offset)
    html = "<html><body>In %s hour(s), it will be %s.</body></html>" % (offset, dt)
    return HttpResponse(html)  	
	
	